﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Items.aspx.cs" Inherits="Admin_Items" ValidateRequest="false"%>
<%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %>
<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<title></title>

<script type="text/javascript">
    function confirmAction() {
        if (confirm('Are you sure want to delete ?')) {
            // you clicked the OK button.
            // you can allow the form to post the data.
            return true;
        }
        else {


            // you clicked the Cancel button.
            // you can disallow the form submission.
            return false;
        }
    }
</script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <form id="form2">
    <div style="background-color: White">
        <asp:Panel ID="SearchPanel" runat="server">
        <div class="formPanel_Items">
            <fieldset>
                
                <legend>Items Manager</legend>
            <asp:Label ID="Label1" runat="server" Text="Category: "></asp:Label>
            <asp:DropDownList ID="cbbCategoryList" runat="server" AutoPostBack="True" 
                    DataTextField="Name" DataValueField="CategoryID" 
                    onselectedindexchanged="cbbCategoryList_SelectedIndexChanged">
            </asp:DropDownList>
            <asp:GridView ID="GridView1" runat="server" 
                AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
                BorderStyle="None" BorderWidth="1px" CellPadding="3"
                onselectedindexchanged="GridView1_SelectedIndexChanged" Width="100%" 
                     EnableModelValidation="True">
                <Columns>
                    <asp:CommandField ButtonType="Image" SelectImageUrl="Images/edit.png" 
                        ShowSelectButton="True">
                    <ItemStyle Width="20px" />
                    </asp:CommandField>
                    <asp:BoundField DataField="ItemID" HeaderText="ItemID" ReadOnly="True" 
                        SortExpression="ItemID">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Left" Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
                        SortExpression="Name">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CreateDate" HeaderText="CreateDate" ReadOnly="True" 
                        SortExpression="CreateDate">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" Width="145px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ViewCount" HeaderText="ViewCount" 
                        SortExpression="ViewCount" />
                </Columns>
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    
           </asp:GridView>

           <asp:Button ID="btn_AddItems" runat="server" Text="Add Items" 
                    onclick="btn_AddItems_Click" />
    
                <br />
                <asp:Label ID="lbl_Message" runat="server" Font-Bold="True" ForeColor="Blue"></asp:Label>
    
            </fieldset>
        </div>
    </asp:Panel>

    <asp:Panel ID="Panel_Add" runat="server">
        <div class="formPanel_Items">
            <fieldset>
                <legend>Add Items</legend>
                Category:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:DropDownList ID="CategoryList_Add" runat="server" DataTextField="Name" 
                    DataValueField="CategoryID">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
                <hr />
                <asp:Panel ID="Panel_AddContent" runat="server">
                    <table class="style1">
                        <tr>
                            <td class="style2">
                                Name:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:TextBox ID="txt_AddTitle" runat="server" Width="100%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                Description:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <FTB:FreeTextBox ID="txtDescription_Add" runat="server" Width="100%">
                                </FTB:FreeTextBox>

                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                Demo Link:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:TextBox ID="txtDemo_Add" runat="server" Width="424px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                TabActive</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:DropDownList ID="cbb_TabActive_Add" runat="server">
                                    <asp:ListItem Selected="True">0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                &nbsp;</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:Button ID="btn_Add" runat="server" onclick="btn_Add_Click" Text="Add" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </fieldset>
        </div>
    </asp:Panel>
    
    <asp:Panel ID="Panel_Edit" runat="server">
    <div class="formPanel_Items">
            <fieldset>
                <legend>Edit Items</legend>
                Category:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:DropDownList 
                    ID="CategoryList_Edit" runat="server" DataTextField="Name" 
                    DataValueField="CategoryID">
                </asp:DropDownList>
                <hr /> 
                <asp:Panel ID="Panel_EditContent" runat="server">
                    <table class="style1">
                        <tr>
                            <td class="style2">
                                Name:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:TextBox ID="txt_EditTitle" runat="server" Width="100%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                Description:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <FTB:FreeTextBox ID="txtDescription_Edit" runat="server" Width="100%">
                                </FTB:FreeTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                Demo Link:</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:TextBox ID="txtDemo_Edit" runat="server" Width="424px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                TabActive</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:DropDownList ID="cbb_TabActive_Edit" runat="server">
                                    <asp:ListItem Selected="True">0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                You want ?</td>
                            <td class="style4">
                                &nbsp;</td>
                            <td>
                                <asp:Button ID="btn_Save" runat="server" onclick="btn_Save_Click" Text="Save" />
                                &nbsp;&nbsp;
                                <asp:Button ID="btn_Delete" runat="server" onclick="btn_Delete_Click" 
                                    OnClientClick="javascript:return confirmAction();" Text="Delete" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </fieldset>
        </div>
    </asp:Panel>
    </div>
    </form>
</asp:Content>
